import java.io.*;

class OutClass {
    private int product;

    static public void main(String args[]) {
        try {
            OutClass testOutClass = new OutClass();
            testOutClass.setProduct(printSum());
            System.out.println("Product is:");
            System.out.println(testOutClass.getProduct());
        } catch (Exception e) {
            System.out.println("Application teminated abnormally.");
            //e.printStackTrace();
        }
    }

    static public int printSum() throws IOException, NumberFormatException{
        class InClass {
            public int getProduct(int multiplicand, int multiplier) {
                return multiplicand * multiplier;
            }
        }

        InClass testClass = new InClass();
        return testClass.getProduct(getInputInteger(), getInputInteger());
    }

    public int getProduct() {
        return product;
    }

    public void setProduct(int _product) {
        product = _product;
    }

    static private int getInputInteger() throws IOException, NumberFormatException{
        try {
            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
            System.out.println("Enter an integer:");
            String inputedIntegerString = stdin.readLine();
            int upperBound = Integer.parseInt(inputedIntegerString);
            return upperBound;
        } catch (IOException e) {
            System.out.println("Standard Input Error!");
            throw e;
        } catch (NumberFormatException e) {
            System.out.println("What you inputed is not a integer!");
            throw e;
        }
    }

}
